{% extends "logbase.html" %}
{% block head %}
<script type="text/javascript">var DHTML_SUITE_THEME = 'zune';</script>
<script type="text/javascript" src="/ovim/media/js/dhtml-suite-for-applications.js"></script>
{% endblock %}

{% block navbar %}
<a class="navbar" href="/ovim/logview/"> >> Log</a>
{% endblock %}

{% block action %}
<div class="action">
	<h3>ACTIONS</h3>
	<div id="actionmenu">
		<ul>
			<li>
				<a href="#" title="Clear logs">
					<img src="/ovim/media/img/process-stop.png"/>
					Clear All!
				</a>
			</li>	
		</ul>
	</div>
</div>
{% endblock %}

{% block content %}
{% if les %}
<div class="ovim_content">
	<h3>Logs</h3>
	<div class="ovim_content_box_table">
		<div>
		<table id="jbTable">
			<thead>
				<tr>
					<td></td>
					<td>Date</td>
					<td>Component</td>
					<td>log</td>
				</tr>
			</thead>
			<tbody>
			{% for le in les %}
				<tr>
				{% ifequal le.loglevel 'INFO' %}
					<td><img src="/ovim/media/img/edit-find-replace.png"></td>
				{% endifequal %}
				{% ifequal le.loglevel 'WARN' %}
					<td><img src="/ovim/media/img/icon_alert.gif"/></td>
				{% endifequal %}
				{% ifequal le.loglevel 'CRIT' %}
					<td><img src="/ovim/media/img/icon_error.gif"/></td>
				{% endifequal %}
				{% ifequal le.loglevel 'DEBUG' %}
					<td><img src="/ovim/media/img/selector-search.gif"/></td>
				{% endifequal %}				
					<td>{{ le.date|date:"j/m/y H:i" }}</td>
					<td>{{ le.component }}</td>
					<td>{{ le.log }}</td>
				</tr>
			{% endfor %}
			</tbody>
		</table>
		</div>
	</div>
</div>
<script type="text/javascript">

var tableWidgetObj = new DHTMLSuite.tableWidget();
tableWidgetObj.setTableId('jbTable');
tableWidgetObj.setTableWidth('95%');
tableWidgetObj.setTableHeight(400);
tableWidgetObj.setColumnSort(Array('S', 'N', 'S', 'S'));
tableWidgetObj.init();
tableWidgetObj.sortTableByColumn(1);
</script>
{% else %}
	<div class="ovim_content">
		<h3>No log found.</h3>
	</div>
{% endif %}
{% endblock %}